//
//  TZBasketBallCell.m
//  X-Tribe
//
//  Created by my-pc on 16/3/30.
//  Copyright © 2016年 Miss.Ou. All rights reserved.
//

#import "TZBasketBallCell.h"
#import "SDCycleScrollView.h"

@interface TZBasketBallCell ()

@property (nonatomic,strong) SDCycleScrollView *cycleScrollView;


@end

@implementation TZBasketBallCell
-(instancetype)initWithFrame:(CGRect)frame
{
    if (self = [super initWithFrame:frame])
    {
        [self createCycleView];
    }

    return self;
    
}

-(void)createCycleView{
    
    NSArray *array = [NSArray arrayWithObjects:[UIImage imageNamed:@"cycle_image1.jpg"],[UIImage imageNamed:@"cycle_image2.jpg"],[UIImage imageNamed:@"cycle_image3.jpg"], nil];

    self.cycleScrollView = [SDCycleScrollView cycleScrollViewWithFrame:self.bounds imagesGroup:array];
//    self.cycleScrollView = [SDCycleScrollView cycleScrollViewWithFrame:self.bounds imageURLStringsGroup:nil];
    self.cycleScrollView.autoScrollTimeInterval = 3.5;
    self.cycleScrollView.pageControlAliment = SDCycleScrollViewPageContolAlimentCenter;
    self.cycleScrollView.dotColor = [UIColor whiteColor]; // 自定义分页控件小圆标颜色
    [self addSubview:self.cycleScrollView];
    
}

-(void)createSubViews
{
    //圆形的篮球屌丝圆圈
    UIImageView *baskIMg = [[UIImageView alloc]init];
    CGFloat height = self.contentView.frame.size.height;
    

    [self.contentView addSubview:baskIMg];
    [baskIMg mas_makeConstraints:^(MASConstraintMaker *make) {
        
        make.top.and.left.and.right.mas_equalTo(0);
        make.width.and.height.mas_equalTo(height - 15);
        
        
    }];
    
    baskIMg.layer.masksToBounds = YES;
    baskIMg.layer.cornerRadius = (height - 15)/2;
    baskIMg.backgroundColor = [UIColor yellowColor];
    
    
    
    //添加文字label
    UILabel *label = [[UILabel alloc]init];
    [self.contentView addSubview:label];
    [label mas_makeConstraints:^(MASConstraintMaker *make) {
        
        make.top.equalTo(baskIMg.mas_bottom);
        make.left.right.bottom.mas_equalTo(0);
    }];
    label.backgroundColor = [UIColor redColor];
    label.font = [UIFont italicSystemFontOfSize:12];
    label.text = @"彤彤";
    
    
}
@end










